package csci6450.chickenFriedFS.nuggetCore;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;


/**
 *  <p style="margin-top: 0">
 *        contains information about what the metaserver knows about a particular 
 *        nugget server.  later, maybe add a timer that notifies the metaserver 
 *        that it needs to be heartbeated.
 *      </p>
 */
public class NuggetServerInfo implements Serializable{

    private String ipAddress;

    private Date lastAccessed;

    private boolean active;

    private int leftOverNuggets;

    private int clientPort;
    
    private int metaPort;

    private ArrayList<Nugget> nuggets;

    private long totalChunks;

    private int replicationPort;

    public NuggetServerInfo (Date date, int nuggetsAvailable, String ipAddress,
            int clientPort, int metaPort, ArrayList<Nugget> nuggets,
            long totalChunks, int replicationPort) {
        this.lastAccessed = date;
        this.leftOverNuggets = nuggetsAvailable;
        this.ipAddress = ipAddress;
        this.clientPort = clientPort;
        this.metaPort = metaPort;
        this.nuggets = nuggets;
        this.totalChunks = totalChunks;
        this.replicationPort = replicationPort;
    }

    /**
     * @return the ipAddress
     */
    public String getIpAddress() {
        return ipAddress;
    }

    /**
     * @param ipAddress the ipAddress to set
     */
    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }

    /**
     * @return the lastAccessed
     */
    public Date getLastAccessed() {
        return lastAccessed;
    }

    /**
     * @param lastAccessed the lastAccessed to set
     */
    public void setLastAccessed(Date lastAccessed) {
        this.lastAccessed = lastAccessed;
    }

    /**
     * @return the active
     */
    public boolean isActive() {
        return active;
    }

    /**
     * @param active the active to set
     */
    public void setActive(boolean active) {
        this.active = active;
    }

    /**
     * @return the leftOverNuggets
     */
    public int getLeftOverNuggets() {
        return leftOverNuggets;
    }

    /**
     * @param leftOverNuggets the leftOverNuggets to set
     */
    public void setLeftOverNuggets(int leftOverNuggets) {
        this.leftOverNuggets = leftOverNuggets;
    }

    /**
     * @return the clientPort
     */
    public int getClientPort() {
        return clientPort;
    }

    /**
     * @param clientPort the clientPort to set
     */
    public void setClientPort(int clientPort) {
        this.clientPort = clientPort;
    }

    /**
     * @return the metaPort
     */
    public int getMetaPort() {
        return metaPort;
    }

    /**
     * @param metaPort the metaPort to set
     */
    public void setMetaPort(int metaPort) {
        this.metaPort = metaPort;
    }

    public ArrayList<Nugget> getNuggets(){
        return this.nuggets;
    }

    public void setNuggets(ArrayList<Nugget> set){
        this.nuggets = set;
    }

    public long getTotalChunks(){
        return this.totalChunks;
    }

    public int getReplicationPort(){
        return this.replicationPort;
    }

    public void setReplicationPort(int set){
        this.replicationPort = set;
    }

}

